#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import yaml
from src.config import load_config

print("=== 直接读取 database.yaml ===")
with open('config/database.yaml', 'r', encoding='utf-8') as f:
    db_config = yaml.safe_load(f)
print(f"Neo4j enabled (direct): {db_config.get('database', {}).get('neo4j', {}).get('enabled', False)}")
print(f"Full Neo4j config (direct): {db_config.get('database', {}).get('neo4j', {})}")

print("\n=== 通过 load_config() 读取 ===")
config = load_config()
print(f"Neo4j enabled (load_config): {config.get('neo4j', {}).get('enabled', False)}")
print(f"Full Neo4j config (load_config): {config.get('neo4j', {})}")

print("\n=== 检查配置结构 ===")
print(f"Config keys: {list(config.keys())}")
if 'databases' in config:
    print(f"Databases keys: {list(config['databases'].keys())}")
    print(f"Neo4j enabled (correct path): {config.get('databases', {}).get('neo4j', {}).get('enabled', False)}")
    print(f"Full Neo4j config (correct path): {config.get('databases', {}).get('neo4j', {})}")
else:
    print("No 'databases' key in config")